package GenericHash;

public class Test {
    public static void main(String[] args) {
        HashBuck<Person,String>  hashBuck = new HashBuck<>();
        Person person = new Person("cao");
        Person person1 = new Person("cao");
        hashBuck.put(person,"1");
        hashBuck.put(person1,"12");      //因为id相同的，所以获得的hash码相同，则插入位置相同，
        System.out.println(hashBuck.get(person1));      // 又因为根据id来判断是否相同，所以key值也一样
        hashBuck.put(new Person("cao"),"25");
        hashBuck.put(new Person("c"),"30");
        hashBuck.put(new Person("a"),"56");

    }
}
